<template>
    <view>
        <!-- 置顶 -->
        <view class="bottom-top" @click="onTop">
            <view class="text-xsl text-bold text-center text-green cuIcon-top"></view>
        </view>
    </view>
</template>

<script>
    export default {
        name: 'tabs',
        data() {
            return {

            }
        },
        onHide() {},
        methods: {
            onTop() {
                uni.pageScrollTo({
                    scrollTop: 0,
                    duration: 300
                });
            },
            onPageScroll(e) { //根据距离顶部距离是否显示回到顶部按钮
                if (e.scrollTop > 600) { //当距离大于600时显示回到顶部按钮
                    this.flag = true
                } else { //当距离小于600时显示回到顶部按钮
                    this.flag = false
                }
            },
        }
    }
</script>

<style>

</style>
